package zhtt.service.user;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import zhtt.rmi.service.MessageProvider;

/**
 * Created by ztt on 2018/5/1.
 */
public class RmiInvoking {

    public static void main(String[] args) {
        ApplicationContext ctx = new FileSystemXmlApplicationContext("classpath:spring-rmi-client.xml");
        System.out.println("加载Spring容器,并初始化RMI客户端");
        MessageProvider client = (MessageProvider)ctx.getBean("messageService");
        String temp = client.queryForMessage("LvSantorini");

        System.out.println("返回结果: " + temp);
    }

}
